package com.dap.oss;

import java.io.InputStream;
import java.util.List;

import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.*;
import com.dap.oss.config.OSSConfig;

public interface UploadService {
    /**
     * 临时文件需要放在该目录
     * */
    String tempFilesPathPrefix = "tempFiles/";

    OSSConfig getOSSConfig();


    PutObjectResult putObject(String bucketName, String key, InputStream inputStream, long fileLength);
    PutObjectResult putObject(String bucketName, String key, InputStream inputStream, ObjectMetadata meta);

    DeleteObjectsResult removeObject(String bucketName, List<String> keys);
    List<OSSObjectSummary> listObjects(String bucketName, String prefix);

    CopyObjectResult copyObject(String sourceBucketName, String sourceKey,
            String destinationBucketName, String destinationKey) throws OSSException, ClientException;

    /**
     * 将临时文件 从 临时目录tempFilesPathPrefix 移出
     * */
    String moveTempObject(String fullUrl) throws OSSException, ClientException;
}
